﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using NPOI.XSSF.UserModel;
using NPOI.XWPF.UserModel;

namespace _180FrameWork.Common
{
    public static class MyWordHelper
    {
        public static MemoryStream CreateFileByTemplate(string FilePath)
        {
            return null;
        }

        public static Byte[] CreateDoc(string strInfo)
        {
            //XWPFDocument d=new XWPFDocument(
            

            XWPFDocument doc = new XWPFDocument();

            

            XWPFParagraph pl = doc.CreateParagraph();
            pl.Alignment = ParagraphAlignment.CENTER;
            XWPFRun rl = pl.CreateRun();

            rl.FontSize = 20;
            //rl.set(true);
            rl.SetText(strInfo);

            //写入流
            MemoryStream ms = new MemoryStream();
            doc.Write(ms);
            return ms.ToArray();
        }
    }
}
